package MySwing;

import java.awt.BorderLayout;
import java.awt.Color;
import java.util.ArrayList;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
public abstract class JAbm extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public JBottomBar buttonBar;
	private BorderLayout borderLayout;
	protected JPanel panelFlowLayout;
	private BoxLayout boxLayout;
	public JAbm()
	{
		buttonBar = new JBottomBar();
		borderLayout = new BorderLayout();
		panelFlowLayout = new JPanel();
		setLayout(borderLayout);
		seteoBackground();
		agregoBotonera();
	}
	private void addPanelFlowLayout()
	{
		panelFlowLayout.setBackground(Color.GREEN);
		boxLayout = new BoxLayout(panelFlowLayout,BoxLayout.Y_AXIS );
		panelFlowLayout.setLayout(boxLayout);
		add(panelFlowLayout,BorderLayout.CENTER);
	}
	private void seteoBackground() {
		setBackground(Color.green);
	}
	private void agregoBotonera() {
		add(buttonBar,BorderLayout.SOUTH);
	}
	protected void agregoComponentesAlPanel(ArrayList<JFormComponent> form)throws Exception
	{
		for (JFormComponent jFormComponent : form) {
			panelFlowLayout.add(jFormComponent);	
			addPanelFlowLayout();
		}
	}
	public JBottomBar getBar()
	{
		return buttonBar;
	}
}
